The present invention relates to MPEG video players, and more particularly to apparatuses and methods of controlling buffers for reverse-play of MPEG video streams.
Generally, MPEG video players are configured to carry out operations of normal-play and reverse-play, in which compressed video bitstreams are provided from a digital video data storage media such as a digital video disc (DVD) or digital video recorder (DVR). DVRs include a hard disk drive and a large capacity memory.
According to the MPEG standard established by the International Organization of Standardization (ISO), MPEG video bitstreams are composed of a multiplicity of frame groups divided into intra-coded frames (I-frames), predictive-coded frames (P-frames), and bidirectionally predictive-coded frames (B-frames). The I-frames are independently coded and are the least efficiently coded of the three frame types. The P-frames are coded more efficiently than are the I-frames and are coded relative to the preciously coded I- or P-frame. The B-frames are coded the most efficiently of the three frame types and are coded relative to both the previous and the next I- or P-frames.
The video bitstreams in MPEG systems include more than one group of pictures (GOP), each of which is composed of a multiplicity of pictures (or frames). The picture groups are accessed in accordance with a reproducing order from the encoded I-frames to the P- or B-frames relative to the I-frames.
A typical method of reverse-play in a MPEG video player involves decoding bitstreams backwards from the reproducing order of a normal MPEG coded video bitstream. In reverse-play, it may be most desirable to reproduce the bitstreams in the direction opposite to the normal output order. However, there are practical limits to the P- or B-frames being reproduced completely unless the I-frames are not reproduced as reference frames for the associated frames (P or B).
One example of reverse-play technique for MPEG video bitstreams is proposed in Japanese Patent Application No. 06-262030 dated Sep. 29, 1994 (Japanese Publication No. 08-102913). The Japanese Application proposes decoding and playing back encoded video bitstreams in a backward order from the encoded order.
Referring to FIG. 1, a conventional MPEG player 10 includes two switch circuits 2 and 4 and a data memory 6 at its input side. When the switch circuits 2 and 4 are connected at terminals A, an input data IN is connected to a video decoder 8. When the switch circuits 2 and 4 are connected at terminals B, the input data IN is written into and read from the data memory 6. In a reverse-play mode, the video decoder 8 decodes each frame and utilizing the data memory 6 and the frame memory 20, outputs a reverse-play video data OUT. The data OUT is output in a backward direction of bitstream order. The pictures of each group are input in the forward direction and reversely played.
In more detail, when an I-picture is entered into the MPEG player 10, the switch circuits 2 and 4 are switched to terminals A and a switch circuit 18 is closed. As a result, the I-picture is decoded by the video decoder 8 and then a reproduced I-picture data from the video decoder 8 is written into the frame memory 20. When a P-picture is input in the same connection states of the switch circuits 2, 4, and 18 with the case of the I-picture, the P-picture is decoded by the video decoder 8. Then, a differential image data decoded by the video decoder 8 and a motion vector data relative to the P-picture are applied to an adder 12. The motion vector data is provided from a motion compensation circuit 14. In this way, the frame memory 20 receives a predictive image data and a reproduced image data of the P-picture for storage. The predictive image data is obtained by the motion compensation circuit 14, which is being used to obtain a reproduced P-picture data prior by one frame to a currently input P-picture or a reproduced I-picture data (e.g., the first P-picture among the group of pictures “GOPs”) by applying a frame selection data to the frame memory 20. The reproduced image data of the P-picture is added to the decoded differential image data at the adder 12.
When a B-picture is input, the switch circuits 2 and 4 are connected to their terminals B to transfer B-pictures among each GOP to the data memory 6.
Thus, the MPEG video player 10 employs the data memory 6 at the front of the video decoder 8 for performing reverse-play operation. The I- and P-pictures are written into or read from the frame memory 20, while the B-picture is written into or retrieved from the data memory 6 in a first-in last-out (FILO) fashion. The B-picture read from the data memory 6 is decoded and put into a motion compensation process with reference to the I-picture or the P-picture, and used as a reference frame corresponding to the decoded B-picture read from the memory 20. After completing the process of motion compensation for the B-picture, the pictures are reversely reproduced in their corresponding GOPs in sequence.
However, in the conventional MPEG player 10, reverse-play can only be performed for picture groups that have the same number of pictures. If there exists irregular numbers of pictures, information about a previous picture group is mismatched during reverse-play.
Further, in the conventional MPEG playing system, the I- and P-pictures used as reference frames are stored in the frame memory 20 in the form of raw data (YUV) while B-pictures are stored in compressed form. The pictures in proper numbers are read out from the data memory 6 to the reference frame and pictures of a previous GOP are rewritten into the read-out position of the data memory 6. During reverse-play mode, when a current picture group is read out downwardly from the top to the bottom in the frame buffer, the next picture group is read out upwardly from the bottom to top in the sequence of first-in last-out (FILO). However, if the picture groups are different from each other in the number of pictures, it is impossible to conduct the reverse-play operation by such manner. And, as two pictures are read out for one reference frame, it is also impossible to conduct the reverse-play operation when their structures of the picture groups are different and there are continuous reference pictures.
Accordingly, a need exists for a MPEG playing system which is capable of reverse-play for video bitstreams composed of picture groups with irregular picture numbers and/or types.